function Star(name, age) {
    this.name = name;
    this.age = age;
}

var that;
Star.prototype.sing = function f(time) {
    console.log('我会唱歌')
    that = this;
}

// 2.利用类创建对象 new
var ldh = new Star('刘德华', 18);

// 1.在构造函数中, 里面this指向的是对象实例 ldh
ldh.sing();

// 2.原型对象函数, 里面的this也是指向的是实例对象ldh
console.log(`that === ldh: ${that === ldh}`)    // true



